#include "theme.h"

Theme::Theme(QDir* dir, QObject *parent) :
    QObject(parent)
{
    this->dir = dir;
    backimg = NULL;
}

void Theme::init()
{
    QStringList list = dir->entryList(QDir::Files, QDir::NoSort);
    waitMusic.clear();
    gameMusic.clear();
    for(int i = 0; i < list.size(); i++)
    {
        if(((QString)list.at(i)).endsWith("backimg.jpg") && backimg==NULL)
            backimg = new QPixmap(dir->path() + "/" + list.at(i));

        if(((QString)list.at(i)).endsWith("wait.mp3"))
            waitMusic.append(dir->path() + "/" + list.at(i));

        if(((QString)list.at(i)).endsWith("game.mp3"))
            gameMusic.append(dir->path() + "/" + list.at(i));
    }
}
